<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript">
        var input01='abcdef';
        var rg01=/B/i;
        //查找所匹配到内容的索引
        var index01=input01.search(rg01);
        console.log('字符B的索引为：'+index01+'。');

        var input02='abc123def';
        var rg02=/\d{3}/;
        var index02=input02.search(rg02);
        console.log('内容的索引为：'+index02+'。');







    </script>`

</head>
<body>


</body>
</html>